package com.hsy.crm.web.web.system;

import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.cm.Unified;
import com.hsy.crm.web.domain.vo.platform.SchemaVo;
import com.hsy.crm.web.service.asyn.SchemaService;
import com.hsy.crm.web.web.BaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/schema")
public class SchemaAction extends BaseAction {

    @Autowired
    SchemaService schemaService;

    @RequestMapping("/init")
    public String init(SchemaVo schemaVo) {
        schemaService.init_data(schemaVo);
        Unified<Integer> unified =  new Unified<>();
        return Response.body(unified);
    }

    @RequestMapping("/resetCost")
    public String resetCost(SchemaVo schemaVo) {
        schemaService.resetCost(schemaVo);
        Unified<Integer> unified =  new Unified<>();
        return Response.body(unified);
    }
}
